import { definePropType } from '@/utils'

export default {
  columns: definePropType<any>(Array),
  http: Function,
  data: {
    type: Array,
    default: () => []
  },
  delHttp: Function,
  editHttp: Function,
  handler: Function,
  params: {
    type: Object,
    default: () => {}
  },
  isReload: {
    type: Boolean,
    default: false
  },
  isLazy: {
    type: Boolean,
    default: () => false
  },
  pageConfig: {
    type: Object,
    default: () => {
      return {
        page: 1,
        pageSize: 10
      }
    }
  }
}

export const editTableEmits = {
  editNext: (data: T) => !!data,
  delNext: (data: T) => !!data,
  // 针对 非 http
  reload: () => true,
  // 针对 http
  'update:isReload': (val: boolean) => val
}
